-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix simulation id validation #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should also add more tests, for piParameters and OutputMappings with sim ids not in the given simulationIds
R/utilities-simulation.R
Outdated
|
||
# Validate that simulationId is idnetical with piParamIds and outputMappingIds | ||
if (!identical(simulationIds, piParamIds) || !identical(simulationIds, outputMappingIds)) { | ||
stop(messages$errorSimulationIdMissing(id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id
is not defined here anymore
R/utilities-simulation.R
Outdated
piParamIds <- sort(piParamIds) | ||
outputMappingIds <- sort(outputMappingIds) | ||
|
||
# Validate that simulationId is idnetical with piParamIds and outputMappingIds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Validate that simulationId is idnetical with piParamIds and outputMappingIds | |
# Validate that simulationId is identical with piParamIds and outputMappingIds |
Also fixes #137 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test should be good enough.
outputMappingIds <- sort(outputMappingIds) | ||
|
||
# Validate that simulationId is identical with piParamIds and outputMappingIds | ||
if (!identical(simulationIds, piParamIds) || !identical(simulationIds, outputMappingIds)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When could this happen? How could the user invoke this behavior? @rengelke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user forget data or parameters or simulations in the ParameterIdentification$new(), for example.
cf added tests
Fixes #127 where validation did not consider that piParams can have multiple levels